{extend name="$_admin_layout"}

{block name="tpl_vars"}
    {assign name="page_title" value="商品管理" /}
{/block}

{block name="main-content"}
    <form id="goods_list" class="table-form table-manager">
        <div class="box box-blue no-heading">
            <div class="box-body">

                <div class="row">
                    <div class="col-sm-12">
                        <div class="table-fixed-toolbar">
                            {:helper('admin/toolbar')->render_button('新建', 'fa fa-plus', 'btn btn-primary form-get', array('url' => $_controller->url('create'), 'target-form' => 'goods_form'))}
                            {:helper('admin/toolbar')->render_button('删除', 'fa fa-trash', 'btn btn-danger ajax-post selected disabled', array('url' => $_controller->url('bulk_delete'), 'target-form' => 'goods_list', 'target-html' => 'goods_list', 'confirm-text' => '确定删除选择的数据吗？'))}
                        </div>
                    </div>
                </div>

                <div class="row">
                    <div class="col-sm-12">
                        <table class="table table-bordered table-striped table-hover">
                            <thead>
                                <tr>
                                    <th class="list-ids">{:helper('admin/table')->render_header_select()}</th>
                                    <th>{:helper('admin/table')->render_header_text('ID')}</th>
                                    <th>{:helper('admin/table')->render_header_text('标题')}</th>
                                    <th>{:helper('admin/table')->render_header_text('封面')}</th>
                                    <th>{:helper('admin/table')->render_header_text('排序')}</th>
                                    <th>{:helper('admin/table')->render_header_text('状态')}</th>
                                    <th>{:helper('admin/table')->render_header_text('操作')}</th>
                                </tr>
                            </thead>
                            <tbody>
                                {notempty name="goods_list"}
                                    {foreach name="goods_list" item="vo"}
                                        <tr>
                                            <td>{:helper('admin/table')->render_column_select($vo['id'], array('selected' => $pagination['selected']))}</td>
                                            <td>{:helper('admin/table')->render_column_text($vo['id'])}</td>
                                            <td>{:helper('admin/table')->render_column_text($vo['title'])}</td>
                                            <td>{:helper('admin/table')->render_column_image($vo['cover'])}</td>
                                            <td>{:helper('admin/table')->render_column_text($vo['sort'])}</td>
                                            <td>{:helper('admin/table')->render_column_status($vo['status'])}</td>
                                            <td>
                                                {:helper('admin/table')->render_action('修改', 'fa fa-edit', 'btn btn-primary btn-xs form-get', array('url' => $_controller->url('modify', array('id' => $vo['id']))))}
                                            </td>
                                        </tr>
                                    {/foreach}
                                {else /}
                                    {:helper('admin/table')->render_empty_row()}
                                {/notempty}
                            </tbody>
                        </table>

                        {notempty name="goods_list"}
                            {:helper('admin/table')->render_pagination($pagination, $_controller->url('index', array('page' => '[page]')))}
                        {/notempty}
                    </div>
                </div>

            </div><!-- /.box-body -->
        </div><!-- /.box -->
    </form>
{/block}
